<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% 
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>公告管理界面</title>
<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/default/easyui.css">
<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/icon.css">
<script type="text/javascript" src="<%=basePath %>js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	<%-- $(function () {
		//页面请求接受树形菜单
		location.href="<%=basePath %>bulletin/bulletinTreeMenuByUserId.do?userId=2&parentId=1";
		/* $.ajax({
			type:"post",
			url:"bulletin/bulletinTreeMenuByUserId.do",
			data:{"userId":2,"parentId":1},
			dataType:"json",
			async:false,
			success:function(data){
			}
		}) */
	}); --%>
	//增加选项卡
	function addTab(url,name) {
		if ($('#center').tabs('exists',name)) {
			$('#center').tabs('select',name);
			var tab =$('#center').tabs('getSelected');
			$('#center').tabs('update',{
				tab:tab,
				options:{}
			});
		}else {
			$('#center').tabs('add',{
				title: name,
				selected: true,
				closable:true,
				style:{"padding":"10px"},
				content:"<iframe src='<%=basePath %>"+url+"?name="+name+"' height='95%' width='100%' scrolling='auto' frameborder='0'></iframe> ",
			});
		}
	}
	
	
	
</script>
</head>

<body class="easyui-layout" id="easyui-layout"> 
    <div  id="west" data-options="region:'west',title:'树形列表'" collapsible="false" style="width:200px;">
    	<ul id="tt" class="easyui-tree"> 
	    	<c:forEach items="${menu}" var="m">
	    		<c:if test="${m.menuLevel==2&&m.menuisShow==1}">
	    			
    				<c:if test="${m.menuUrl != null}">
	    				<li  data-options="iconCls:'${m.menuIcon}'"> 
	    					<span><a href="javascript:addTab('${m.menuUrl}','${m.menuname}');">${m.getMenuname()}</a></span>
    						<ul>
								<c:forEach items="${menu}" var="m2">
									<c:if test="${m2.menuLevel==3&&m2.menuparentld==m.menuid&&m2.menuisShow==1}">
										<li>
											<span><a  href="javascript:addTab('${m2.menuUrl}','${m2.menuname}');">${m2.menuname}</a></span>
										</li>
									</c:if> 
								</c:forEach>
							</ul> 
						</li> 
    				</c:if>
    				<c:if test="${m.menuUrl == null}">
    					<li> 
    						<span>${m.getMenuname()}</span>
   							<ul>
								<c:forEach items="${menu}" var="m2">
									<c:if test="${m2.menuLevel==3&&m2.menuparentld==m.menuid&&m2.menuisShow==1}">
										<li>
											<span><a  href="javascript:addTab('${m2.menuUrl}','${m2.menuname}');">${m2.menuname}</a></span>
										</li>
									</c:if> 
								</c:forEach>
							</ul> 
						</li> 
    				</c:if>
	    		</c:if>
			</c:forEach>  
    </div>   
    <div  id="center" data-options="region:'center'" class="easyui-tabs" tabHeight="24px" tabWidth="100px" style="padding:0px;">
    	<div title="首页" style="padding:20px;" >   
		        欢迎使用       ！！！
		</div>
    </div>   
</body> 
</html>